$(function() {
	var userId = getCookie('userId');
	if(userId) {
		$('#loged').css({display:'block'});
		$('#unlog').css({display:'none'});
		$('#logout-btns').show();
	} else {
		$('#loged').css({display:'none'});
		$('#unlog').css({display:'block'});
		$('#logout-btns').hide();
	}
});

$.ajax({
	type: "post",
	async: false,
	url: new Common().AppRoot + "/wxpatient/opr/getopenid4officialaccount",
	dataType: "json",
	data: {
		"code": code
	},
	success: function (response) {
		alert(response);
		alert(JSON.stringify(response));
		$("#xingming").val(JSON.stringify(response));

	},
	error: function (XMLHttpRequest, textStatus, errorThrown) {
		rv = "XMLHttpRequest.status=" + XMLHttpRequest.status + ",XMLHttpRequest.readyState=" + XMLHttpRequest.readyState
			+ ",textStatus=" + textStatus;
	},
	complete: function (XHR, TS) {
		XHR = null
	}
});